<template>
    <div class="collectmoney">
        <div class="collectmoneybg">
            <img class="collectmoneybg-img" src="@/assets/images/red/get_money.jpg" alt="">
        </div>
        <div class="collectmoneybtn">
            <div class="collectmoneybtnbg">
                <div v-if="this.$route.query.id == 2" @click="gomessagectiy"><img class="collectmoneybtn-img"
                        src="@/assets/images/red/btn_collectmoney.png" alt=""></div>
                <div v-if="this.$route.query.id == 1" @click="gommse"><img class="collectmoneybtn-img"
                        src="@/assets/images/red/btn_collectmoney_1.png" alt=""></div>
                <div v-if="this.$route.query.id == 3" @click="gommse"><img class="collectmoneybtn-img"
                        src="@/assets/images/red/returnhome.png" alt=""></div>
            </div>
        </div>
    </div>
</template>
<script>
import { addpacketstep, addburyingpoint } from '@/api/http.js'
export default {
    data() {
        return {

        }
    },
    created() {
        console.log(this.$route.query.id)
    },
    methods: {
        gommse() {
            console.log(1, this.$route.query.path == 'emt')
            if (this.$route.query.path == 'emt') {
                let obj = { buriedPointName: '第二组题结束', function: '2', module: '2', redirectPage: '第二组题提现成功到第三组题', section: '5', orgNo: '' }
                addburyingpoint(obj).then(res => {
                    console.log(res)
                })
                let url = encodeURIComponent('emt')
                addpacketstep(url).then(res => {
                    this.$router.push('/emt')
                })
            } else if (this.$route.query.path == 'mmse') {
                let obj = { buriedPointName: '第一组题结束', function: '2', module: '1', redirectPage: '第一组题提现成功到第二组题', section: '5', orgNo: '' }
                addburyingpoint(obj).then(res => {
                    console.log(res)
                })
                let url = encodeURIComponent('mmse')
                addpacketstep(url).then(res => {
                    this.$router.push('/mmse')
                })

            } else if (this.$route.query.path == 'activity') {
                let url = encodeURIComponent('activity')
                addpacketstep(url).then(res => {
                    this.$router.push('/activity')
                })
            } else if (this.$route.query.path == 'bannersearch') {
                let url = encodeURIComponent('bannersearch')
                addpacketstep(url).then(res => {
                    this.$router.push('/bannersearch')
                })

            }

        },
        gomessagectiy() {
            console.log('1')
            if (this.$route.query.path == 'messagecity') {
                let url = encodeURIComponent('messagecity')
                addpacketstep(url).then(res => {
                    this.$router.push('/messagecity')
                })
            }
        },
        getaddpacketstep(data) {
            let url = encodeURIComponent(`collectmoney?id=2&path=${data}`)
            addpacketstep(url).then(res => {
                console.log(res)
            })
        }
    },
    mounted() {
        //collectmoney?id=1&path=mmse
        let url = encodeURIComponent(this.$route.name + '?id=' + this.$route.query.id + '&path=' + this.$route.query.path)
        addpacketstep(url).then(res => {
            console.log(res)
        })
    }
}
</script>
<style>
.collectmoney {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.collectmoneybg {
    width: 100%;
    height: 100%;
}

.collectmoneybg-img {
    width: 100%;
    height: 100%;
}

.collectmoneybtn {
    width: 375px;
    position: absolute;
}

.collectmoneybtnbg {
    width: 196px;
    height: 63px;
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
}

.collectmoneybtn-img {
    width: 100%;
    height: 100%;
}
</style>